/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.spring.Model;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
 *
 * @author kerife
 */
@Embeddable
public class SalonPK implements Serializable {
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 10)
    @Column(name = "id_salon")
    private String idSalon;
    @Basic(optional = false)
    @NotNull
    @Column(name = "letra")
    private char letra;

    public SalonPK() {
    }

    public SalonPK(String idSalon, char letra) {
        this.idSalon = idSalon;
        this.letra = letra;
    }

    public String getIdSalon() {
        return idSalon;
    }

    public void setIdSalon(String idSalon) {
        this.idSalon = idSalon;
    }

    public char getLetra() {
        return letra;
    }

    public void setLetra(char letra) {
        this.letra = letra;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idSalon != null ? idSalon.hashCode() : 0);
        hash += (int) letra;
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof SalonPK)) {
            return false;
        }
        SalonPK other = (SalonPK) object;
        if ((this.idSalon == null && other.idSalon != null) || (this.idSalon != null && !this.idSalon.equals(other.idSalon))) {
            return false;
        }
        if (this.letra != other.letra) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "Entity.SalonPK[ idSalon=" + idSalon + ", letra=" + letra + " ]";
    }
    
}
